﻿/*=========================================================================
 * AUTH: Vincent Breton
 * DESC: Seek Steering Behavior
 *=========================================================================*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;   //   for Texture2D
using Microsoft.Xna.Framework;  //  for Vector2
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;


namespace RisingThreat
{
    class Seek
    {
        public Vector3 target { get; set; }
       
        public Steering steer;

        public Seek()
        {


        }

        public virtual Steering getSteering(Steering s)
        {
            steer = s;
            seekHelper();
            return steer;
        }

        public void seekHelper()
        {
            Vector3 temp = target - steer.position;
            if(temp.Length() > 0)
                temp.Normalize();
            steer.acceleration = temp;
            steer.acceleration *= steer.maxAcceleration;
        }
    }
}
